package com.ruoyi.flowable.listener;

import org.flowable.engine.delegate.DelegateExecution;
import org.flowable.engine.delegate.ExecutionListener;
import org.flowable.engine.delegate.TaskListener;
import org.flowable.task.service.delegate.DelegateTask;

import java.util.Arrays;

public class MyExecutionListener implements ExecutionListener {

    @Override
    public void notify(DelegateExecution execution) {
        System.out.println("领导发起流程："+execution.getProcessInstanceId());
        String assigneeList = String.valueOf(execution.getVariable("assigneeList"));
        if(assigneeList != null){
            // 根据逗号分割并以数组形式重新设置进去
            execution.setVariable("assigneeList", Arrays.asList(assigneeList.split(",")));
        }
    }
}
